-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added comments to posts #4
base: master
Are you sure you want to change the base?
Conversation
const CN = 'loading-center'; | ||
export const LoadingIndicator = () => { | ||
return ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty lines on lines 4,8,13 are useless and can be deleted
animation: loadingspin 2s linear infinite; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line can be deleted
100% { | ||
transform: rotate(360deg) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line can be deleted
import { PostImage } from '../PostImage/PostImage'; | ||
import { accessToken } from '../../constants'; | ||
import React, {Component} from "react"; | ||
import {accessToken} from '../../constants'; | ||
import "./Post.scss"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling import should be the last one on line 7
if (!commentsLoaded) { | ||
return this.onLoadComments() | ||
} else { | ||
return this.setState({commentsSectionExpanded: !commentsSectionExpanded}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can skip return
here just use
this.onLoadComments()
and
this.setState({commentsSectionExpanded: !commentsSectionExpanded});
<div className={`${CN}__link-btn`} onClick={this.onShowComments}> | ||
{commentsSectionExpanded ? "Hide comments" : "Show comments"} | ||
</div> | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This div
is not needed and can be deleted
} | ||
{ | ||
{commentsSectionExpanded && !isCommentsLoading && commentsLoaded && !comments.length && | ||
<div className={`${CN}__no-results`}>{"No comments for this post yet"}</div>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brackets are not needed here inside tag cause you are putting simple string as a child
can be just
<div className={
${CN}__no-results}>"No comments for this post yet"</div>
@@ -1,9 +1,9 @@ | |||
import React, { Component } from 'react'; | |||
|
|||
import { Post } from '../Post/Post'; | |||
import { List } from '../List/List'; | |||
import { accessToken } from '../../constants'; | |||
import './UserDetails.scss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling import should be the last one among imports
No description provided.